.class public Lcom/glympse/android/glympse/DlgPrompt;
.super Lcom/glympse/android/glympse/DlgShell;
.source "DlgPrompt.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/glympse/android/glympse/DlgPrompt$EnterKeyListener;
    }
.end annotation


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1
    .parameter "oContext"
    .parameter "strName"

    .prologue
    .line 29
    const v0, 0x7f03000a

    invoke-direct {p0, p1, p2, v0}, Lcom/glympse/android/glympse/DlgShell;-><init>(Landroid/content/Context;Ljava/lang/String;I)V

    .line 30
    return-void
.end method


# virtual methods
.method public GetEditText()Landroid/widget/EditText;
    .locals 1

    .prologue
    .line 35
    const v0, 0x7f0c002f

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgPrompt;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/EditText;

    return-object p0
.end method

.method public GetText()Ljava/lang/String;
    .locals 1

    .prologue
    .line 47
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgPrompt;->GetEditText()Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-interface {v0}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public GetTextView()Landroid/widget/TextView;
    .locals 1

    .prologue
    .line 41
    const v0, 0x7f0c002e

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgPrompt;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/TextView;

    return-object p0
.end method

.method public SetEditText(Ljava/lang/String;IZ)V
    .locals 5
    .parameter "strText"
    .parameter "nMaxLen"
    .parameter "fCapitalizeSentences"

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 67
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgPrompt;->GetEditText()Landroid/widget/EditText;

    move-result-object v0

    .line 70
    .local v0, oEditText:Landroid/widget/EditText;
    if-lez p2, :cond_0

    .line 72
    new-array v1, v4, [Landroid/text/InputFilter;

    new-instance v2, Landroid/text/InputFilter$LengthFilter;

    invoke-direct {v2, p2}, Landroid/text/InputFilter$LengthFilter;-><init>(I)V

    aput-object v2, v1, v3

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setFilters([Landroid/text/InputFilter;)V

    .line 76
    :cond_0
    new-instance v1, Lcom/glympse/android/glympse/DlgPrompt$EnterKeyListener;

    const/4 v2, 0x0

    invoke-direct {v1, p0, v2}, Lcom/glympse/android/glympse/DlgPrompt$EnterKeyListener;-><init>(Lcom/glympse/android/glympse/DlgPrompt;Lcom/glympse/android/glympse/DlgPrompt$EnterKeyListener;)V

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V

    .line 79
    if-eqz p3, :cond_1

    .line 81
    new-instance v1, Landroid/text/method/TextKeyListener;

    sget-object v2, Landroid/text/method/TextKeyListener$Capitalize;->SENTENCES:Landroid/text/method/TextKeyListener$Capitalize;

    invoke-direct {v1, v2, v4}, Landroid/text/method/TextKeyListener;-><init>(Landroid/text/method/TextKeyListener$Capitalize;Z)V

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setKeyListener(Landroid/text/method/KeyListener;)V

    .line 85
    :cond_1
    invoke-static {p1}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    .line 88
    invoke-static {v0, v3}, Lcom/glympse/android/glympse/Glympse;->SetVisibilityIfChanged(Landroid/view/View;I)Z

    .line 89
    return-void
.end method

.method public SetPrompt(I)V
    .locals 1
    .parameter "nPromptId"

    .prologue
    .line 53
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgPrompt;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/glympse/android/glympse/DlgPrompt;->SetPrompt(Ljava/lang/String;)V

    .line 54
    return-void
.end method

.method public SetPrompt(Ljava/lang/String;)V
    .locals 2
    .parameter "strPrompt"

    .prologue
    .line 59
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgPrompt;->GetTextView()Landroid/widget/TextView;

    move-result-object v0

    .line 60
    .local v0, oTextView:Landroid/widget/TextView;
    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 61
    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/glympse/android/glympse/Glympse;->SetVisibilityIfChanged(Landroid/view/View;I)Z

    .line 62
    return-void
.end method
